//
//  AutocompletionTableView.h
//
//  Created by Gushin Arseniy on 11.03.12.
//  Copyright (c) 2012 Arseniy Gushin. All rights reserved.
//

#import <UIKit/UIKit.h>
#define ACOShowSuggestionsOnTop @"ACOShowSuggestionsOnTop"

@class AutocompletionTableView;

@protocol AutocompletionTableViewDelegate <NSObject>

@required

- (NSArray*) autoCompletion:(AutocompletionTableView*) completer;

- (void) autoCompletion:(AutocompletionTableView*) completer didSelectAutoCompleteSuggestionWithIndex:(NSInteger) index;

@end

@interface AutocompletionTableView : UITableView <UITableViewDataSource, UITableViewDelegate>
// Dictionary of NSStrings of your auto-completion terms
@property (nonatomic, strong) NSArray *suggestionsDictionary; 

// Delegate for AutocompletionTableView
@property (nonatomic, strong) id<AutocompletionTableViewDelegate> autoCompleteDelegate;
// Dictionary of auto-completion options (check constants above)
@property (nonatomic, strong) NSDictionary *options;

// Call it for proper initialization
- (UITableView *)initWithTextField:(UITextField *)textField inViewController:(UIViewController *) parentViewController withOptions:(NSDictionary *)options;
@end
